import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class sumTwoNumber {
    public static void main(String[] args) {
        List<Integer>numbers = new ArrayList();
        List<Integer>result = new ArrayList();
        Scanner scanner = new Scanner(System.in);
        int target ;
        //控制台手动输入target值
        System.out.println("请输入target值：");
        target = scanner.nextInt();
        System.out.println("要求取的目标值为："+target);
        System.out.println("请输入5个数字：");
        for(int i=0;i<5;i++){
            int insert;
            insert = scanner.nextInt();
            numbers.add(insert);
        }
        System.out.println("输入的数组为："+numbers);
        for(int i =0;i<numbers.size();i++){
            for(int j=i+1;j<numbers.size()-j;j++){
                int sum = numbers.get(i) + numbers.get(j);
                if(sum == target){
                    result.add(i);
                    result.add(j);
                    System.out.println(result);
                    break;
                }
            }
        }


    }
}
